﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Spore.Utils
{
    public interface IThreadWorkItem
    {
        /// <summary>
        /// 开始执行工作事件，该事件方法也在线程工作器上执行。
        /// </summary>
         event Action<IThreadWorkItem> BeginExeWorkEventHandle;
        /// <summary>
        /// 结束工作事件，该事件方法也在线程工作器上执行。
        /// </summary>
         event Action<ThreadExeResult, IThreadWorkItem> EndExeWorkEventHandle;

        /// <summary>
        /// 工作优先级
        /// </summary>
         ThreadWorkPriority Priority
         {
             get;
         }

        /// <summary>
        /// 工作执行状态
        /// </summary>
        ThreadWorkItemState ExeState
        {
            get;
        }

        /// <summary>
        /// 工作执行结果
        /// </summary>
         ThreadExeResult ExeResult
        {
            get;
        }

        /// <summary>
        /// 指定在后台线程调用的方法
        /// </summary>
        Delegate WorkDele
        {
            get;
            set;
        }

        /// <summary>
        /// 指定在后台线程上调用的参数
        /// </summary>
        object[] WorkParams
        {
            get;
            set;
        }

        /// <summary>
        /// 指定是否取消调用
        /// </summary>
        bool IsCancel
        {
            get;
            set;
        }
    }
}
